package com.learn.xml_config.basic_config.factory;

import com.learn.xml_config.basic_config.beans.dao.UserDao;
import com.learn.xml_config.basic_config.beans.dao.UserDaoImpl;
import org.springframework.beans.factory.FactoryBean;

public class FactoryBeanImpl implements FactoryBean<UserDao> {
    @Override
    public UserDao getObject() throws Exception {
        // 不同于BeanFactory立即创建Bean，创建Bean前可进行其他业务逻辑操作
        return new UserDaoImpl();
    }
    
    @Override
    public Class<?> getObjectType() {
        return UserDao.class;
    }
    
    @Override
    public boolean isSingleton() {
        return true;
    }
}
